# Contributor: Feng Shu <tumashu@163.com>

_realname=rime-prelude
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
         "${MINGW_PACKAGE_PREFIX}-librime-data")
pkgver=0.0.0.20210627
_commit=3de303ffaa731dba07b0462ce59f4767e1219ad2
pkgrel=1
pkgdesc="Essential files for building up your Rime configuration (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32')
url="https://github.com/rime/rime-prelude"
license=('LGPL')
source=("https://github.com/rime/rime-prelude/archive/${_commit}/rime-prelude-${_commit}.tar.gz")
sha512sums=('3471339cecd6b98d06a8c028048411bf3213ee30c995ec869d7e1330343a4f3b7a2ec58c2218e7e9cbbbf6d880e3d3589e5073068cbbb22e977736aa1caaf5cf')

eval "package_${MINGW_PACKAGE_PREFIX}-${_realname}() {
  cd rime-prelude-\$_commit
  install -Dm644 *.yaml -t \${pkgdir}\${MINGW_PREFIX}/share/rime-data/
}"

eval "package_${MINGW_PACKAGE_PREFIX}-librime-data() {
  pkgdesc='Meta package of preset librime data (mingw-w64)'
  depends=(${MINGW_PACKAGE_PREFIX}-rime-bopomofo
           ${MINGW_PACKAGE_PREFIX}-rime-cangjie
           ${MINGW_PACKAGE_PREFIX}-rime-essay
           ${MINGW_PACKAGE_PREFIX}-rime-luna-pinyin
           ${MINGW_PACKAGE_PREFIX}-rime-prelude
           ${MINGW_PACKAGE_PREFIX}-rime-stroke
           ${MINGW_PACKAGE_PREFIX}-rime-terra-pinyin)
}"
